package asteroids.model.programs.parsing.statements;

import asteroids.model.programs.parsing.ProgramFactory.ForeachType;

public class ForEachLoop extends CollectionStatement {

	private ForeachType type;
	private String variableName;
	public ForEachLoop(int line, int column, ForeachType type, String variableName, S body) {
		super(line, column,body);
		setType(type);
		setVariableName(variableName);
	}
	
	private void setType(ForeachType type){
		this.type = type;
	}
	
	public ForeachType getType(){
		return this.type;
	}
	
	private void setVariableName(String variableName){
		this.variableName = variableName;
	}
	
	public String getVariableName(){
		return this.variableName;
	}
	
	
	

	@Override
	public void execute(ExecuteManager executeManager) {
		executeManager.execute(this);
	}
	public void redo(){
		if(getExecuted()){
			getBody().redo();
		}
		super.redo();
	}
	

}
